import 'dart:developer' as developer;

const String DEFAULT_TAG = "__imperius__";

class Logger {
  static void v({Object tag = DEFAULT_TAG, Object msg}) {
    _print(LogLevel.Verbose, tag: tag, msg: msg);
  }

  static void d({Object tag = DEFAULT_TAG, Object msg}) {
    _print(LogLevel.Debug, tag: tag, msg: msg);
  }

  static void i({Object tag = DEFAULT_TAG, Object msg}) {
    _print(LogLevel.Info, tag: tag, msg: msg);
  }

  static void w({Object tag = DEFAULT_TAG, Object msg}) {
    _print(LogLevel.Warn, tag: tag, msg: msg);
  }

  static void e({Object tag = DEFAULT_TAG, Object msg}) {
    _print(LogLevel.Error, tag: tag, msg: msg);
  }

  static void a({Object tag = DEFAULT_TAG, Object msg}) {
    _print(LogLevel.Assert, tag: tag, msg: msg);
  }

  static _print(LogLevel logLevel, {Object tag, Object msg}) {
    if (logLevel == LogLevel.Debug || logLevel == LogLevel.Assert) {
      developer.log(msg, name: tag);
      return;
    }
    print("Log:$logLevel========Tag:$tag========Message:$msg");
  }
}

enum LogLevel { Verbose, Debug, Info, Warn, Error, Assert }
